import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// 商品管理模块
const goodsRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		path: "/Goods",
		meta: {
			title: "商品管理"
		},
		children: [
			{
				path: "/Goods/list",
				element: lazyLoad(React.lazy(() => import("@/views/goods/list/index"))),
				meta: {
					requiresAuth: true,
					title: "商品列表",
					key: "goodsList"
				}
			},
			{
				path: "/Goods/add",
				element: lazyLoad(React.lazy(() => import("@/views/goods/add/index"))),
				meta: {
					requiresAuth: true,
					title: "商品发布",
					key: "goodsAdd"
				}
			},
			{
				path: "/Goods/detail",
				element: lazyLoad(React.lazy(() => import("@/views/goods/detail/index"))),
				meta: {
					requiresAuth: false,
					title: "商品详情",
					key: "goodsDetail"
				}
			}
		]
	}
];

export default goodsRouter;
